﻿namespace EFS.RC.CC.Config.Scheduler
{
	public class Exception : EFS.RC.CC.Config.Scheduler.Day 
	{
		/// date
		public System.DateTime Date { get; private set; }

		/// <summary>
		/// Time
		/// </summary>
		public Exception()
		{
		}  

		/// Serialize
		public override void Serialize(EFS.Common.Serialization.XmlWriter xmlWriter)
		{
			base.Serialize(xmlWriter);
		}

		/// Deserialize
		public override void Deserialize(EFS.Common.Serialization.XmlReader xmlReader)
		{
			base.Deserialize(xmlReader);

			// read
			Date = System.DateTime.ParseExact(
					xmlReader.Read("Date"),
					new System.String[] { "yyyy-MM-dd", "dd/MM/yyyy", "d/M/yyyy", "dd-MM-yyyy", "d-M-yyyy", "dd.MM.yyyy", "d.M.yyyy",  "yyyy/MM/dd", "yyyy-MM-dd" },
					new System.Globalization.CultureInfo("en-GB", true),
					System.Globalization.DateTimeStyles.None);
		}
	}
}